<?php
include_once("./common.inc.php");
$smarty = new Tpl();
$id = intval(get_param("id"));
$artModel = new Model("article");
$artinfo = $artModel->where("A.id=$id")->get_view('artinfo');
if( is_array($artinfo) ){
	$artinfo = $artinfo[0];
	$smarty->assign("artinfo", $artinfo);

	//广告图
	$advModel = new Model('advertise');
	$adv = $advModel->where(array('type'=>4,'link'=>$artinfo['category']))->get_one();
	$smarty->assign('adv',$adv);
	$smarty->assign('keywords', $artinfo['keywords']);
	$smarty->assign("titles", $artinfo['titles']);
	$smarty->assign("descriptions", $artinfo['descriptions']);
}
// 产品
$product = new Model("product");
$product = $product->order('`order`, id desc')->get();
if( is_array($product) ) $smarty->assign('product', $product);

//广告图
$advModel = new Model('advertise');
$adv = $advModel->where(array('type'=>5,'subtitle'=>$id))->order('id DESC')->get_one();
$smarty->assign('adv',$adv);

$smarty->display("article.html");
